package com.runshu.runshuwulian.adapter;

import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.hyphenate.easeui.mwidget.brvahrecyclerview.BaseQuickAdapter;
import com.hyphenate.easeui.mwidget.brvahrecyclerview.BaseViewHolder;
import com.runshu.runshuwulian.R;
import com.runshu.runshuwulian.bean.XiaoHaoListBean;

import java.util.List;

import butterknife.BindView;

/**
 * Demo class
 *
 * @author yu
 * @date 11/26/20
 * @decs：
 */

public class XiaoHaoAdapter extends BaseQuickAdapter<XiaoHaoListBean.RecordsBean, BaseViewHolder> {

    public XiaoHaoAdapter(@Nullable List<XiaoHaoListBean.RecordsBean> data) {
        super( R.layout.item_xiaohao_list, data );
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, XiaoHaoListBean.RecordsBean item) {
        helper.setText( R.id.tv_xhd, "消耗单：" + item.getConsumeNumber() );
        helper.setText( R.id.tv_ks, item.getDepartmentName() );
        helper.setText( R.id.tv_sl, item.getProductNumber() );
        helper.setText( R.id.tv_name, item.getUserName() );
        helper.setText( R.id.tv_time, item.getOperationTime() );
        switch (item.getOrderStatus()){
            case 0:
                helper.setImageResource( R.id.iv_state,R.drawable.icon_dqr);
                break;
            case 1:
                helper.setImageResource( R.id.iv_state,R.drawable.icon_yqr);
                break;
            case 2:
                helper.setImageResource( R.id.iv_state,R.drawable.icon_ybh);
                break;
            case 3:
                helper.setImageResource( R.id.iv_state,R.drawable.icon_yqx);
                break;
        }
    }
}